#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <alsa/asoundlib.h>

#include "decode.h"
#include "mad.h"
#include "player.h"

struct buffer data;


int main()
{
	int fd = 0;
	data.fd = fd;

	data.buflen = -1;
	printf("ready read\n");
	read(fd, data.buff, BUFSIZE);
	printf("readed\n");
	data.bufsize = BUFSIZE;
	data.bufpos = 0;

	if (open_pcm_device() != 0) {
		fprintf(stderr, "open_pcm_device():error!\n");
		return 1;
	}

	decode(&data);

	close_pcm_device();
	return 0;
}
